

find_package(Boost REQUIRED COMPONENTS unit_test_framework json)

# include_directories(${BOOST_INCLUDEDIR})
# link_directories(${BOOST_LIBRARYDIR})

function(test_f cppname)
    add_executable(${cppname} ${cppname}.cpp)
    target_include_directories(${cppname}
        PRIVATE
        ${CMAKE_SOURCE_DIR}/include
        ${Boost_INCLUDEDIR}
    )
    target_link_libraries(${cppname}
        PRIVATE
        ${Boost_LIBRARIES}
    )
    add_test(
        NAME ${cppname}
        COMMAND ${cppname}
    )
endfunction()

test_f(is_output_streamable)
test_f(quick)
# test_f(throw_exception)
test_f(variant_alternative)
test_f(variant_convert_construct_throw)
test_f(variant_convert_construct)

# cmake_install_test
# cmake_subdir_test
test_f(variant_copy_assign)
test_f(variant_copy_assign_cx)
test_f(variant_copy_assign_throw)
test_f(variant_copy_construct)
test_f(variant_copy_construct_cx)
test_f(variant_copy_construct_throw)
test_f(variant_default_construct)
test_f(variant_default_construct_cx)
test_f(variant_derived_construct)
test_f(variant_destroy)
test_f(variant_emplace_index)
test_f(variant_emplace_index_cx)
test_f(variant_emplace_type)
test_f(variant_emplace_type_cx)
test_f(variant_eq_ne)
test_f(variant_eq_ne_cx)
test_f(variant_get_by_index)
test_f(variant_get_by_index_cx)
test_f(variant_get_by_type)
test_f(variant_get_by_type_cx)
test_f(variant_hash)
test_f(variant_holds_alternative)
test_f(variant_holds_alternative_cx)
test_f(variant_in_place_index_construct)
test_f(variant_in_place_index_construct_cx)
test_f(variant_in_place_type_construct)
test_f(variant_in_place_type_construct_cx)
test_f(variant_json_value_from)
test_f(variant_json_value_to)
test_f(variant_lt_gt)
test_f(variant_lt_gt_cx)
test_f(variant_many_types)
test_f(variant_move_assign)
test_f(variant_move_assign_cx)
test_f(variant_move_assign_throw)
test_f(variant_move_construct)
test_f(variant_move_construct_cx)
test_f(variant_move_construct_throw)
test_f(variant_ostream_insert)
test_f(variant_size)
test_f(variant_special)
test_f(variant_subset)
test_f(variant_swap)
test_f(variant_trivial)
test_f(variant_value_assign)
test_f(variant_value_assign_cx)
test_f(variant_value_construct)
test_f(variant_value_construct_cx)
test_f(variant_valueless)
test_f(variant_visit)
test_f(variant_visit_by_index)
test_f(variant_visit_derived)
test_f(variant_visit_r)
